// 不遵循依赖倒置原则的反例

// 具体的询价渠道实现细节暴露给高层模块
class PriceServiceBad {
    private tongChengChannel: TongChengChannel;
    private xieChengChannel: XieChengChannel;
    private feiZhuChannel: FeiZhuChannel; // 新增的渠道
    constructor() {
        this.tongChengChannel = new TongChengChannel();
        this.xieChengChannel = new XieChengChannel();
        this.feiZhuChannel = new FeiZhuChannel(); // 创建新的渠道实例
    }

    getPriceFromTongCheng(productId: string): number {
        return this.tongChengChannel.getPrice(productId);
    }

    getPriceFromXieCheng(productId: string): number {
        return this.xieChengChannel.getPrice(productId);
    }
    getPriceFromFeiZhu(productId: string): number {
        return this.feiZhuChannel.getPrice(productId);
    }
}

// 具体的询价渠道实现
class TongChengChannel {
    getPrice(productId: string): number {
        // 实际的价格获取逻辑
        // ...
        return 100; // 假设获取的价格为 100 元
    }
}

class XieChengChannel {
    getPrice(productId: string): number {
        // 实际的价格获取逻辑
        // ...
        return 120; // 假设获取的价格为 120 元
    }
}
class FeiZhuChannel {
    getPrice(productId: string): number {
        // 实际的价格获取逻辑
        // ...
        return 150; // 假设获取的价格为 150 元
    }
}
// 示例用法
const priceService = new PriceServiceBad();
console.log(priceService.getPriceFromTongCheng("123")); // 输出 TongCheng 价格
console.log(priceService.getPriceFromXieCheng("456"));  // 输出 XieCheng 价格
console.log(priceService.getPriceFromFeiZhu("789"));     // 输出 FeiZhu 价格
